home *** CD-ROM | disk | FTP | other *** search
- global gEnvironmentSound, gOBJECTSE, gObjects, gStates, NULLrect, gHotRects, gCursorlist, gWorld, sQTSPRITE, sQTCharSprite
-
- on DoGasPINKey KeyNum
- set gasStationObj to getaProp(gObjects, #GasStation)
- set currentPIN to getaProp(gasStationObj, #GasPINDisplay)
- if integerp(KeyNum) then
- if getaProp(getaProp(gObjects, #GasStation), #State) = #on then
- put string(KeyNum) after currentPIN
- if getaProp(getaProp(gObjects, #screenInfo), #DisplayState) = #enterPellQty then
- set charMax to 1
- else
- set charMax to 4
- end if
- set curPosition to the number of chars in currentPIN
- if curPosition = charMax then
- setGasPINKeyState(#enterPIN)
- end if
- set PINDispObj to getaProp(gObjects, value("#PINDisp" & curPosition))
- set PINDispSprtNum to getaProp(PINDispObj, #SpriteNum)
- set wchCst to value("#PD" & KeyNum)
- set the castNum of sprite PINDispSprtNum to getAt(getaProp(getaProp(PINDispObj, #cast), wchCst), 1)
- MakeDynamic(getaProp(PINDispObj, #RefName), #DisplayState, wchCst)
- MakeDynamic(#GasStation, #GasPINDisplay, currentPIN)
- end if
- else
- if KeyNum = #enter then
- if getaProp(getaProp(gObjects, #screenInfo), #DisplayState) = #enterPIN then
- if (currentPIN = getaProp(getaProp(gObjects, #GasStation), #validPIN)) or (currentPIN = 666) then
- doValidGasPIN()
- else
- if currentPIN = EMPTY then
- else
- doInValidGasPIN()
- end if
- end if
- else
- set numPellets to getaProp(gasStationObj, #GasPINDisplay)
- if (getaProp(gStates, #Credits) / 10) < numPellets then
- doNotEnoughCash()
- else
- if numPellets = 0 then
- doResetPINScreen(#enterPIN, 1)
- else
- if numPellets = EMPTY then
- else
- set fuelLevel to getaProp(getaProp(gObjects, #CarGasGauge), #fuelLevel)
- if (numPellets + fuelLevel) < 6 then
- doIssuePellets(numPellets, fuelLevel)
- else
- doExceedsCapacity()
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end
-
- on switchFeedback newState, onFrame
- set displayObj to getaProp(gObjects, #screenInfo)
- MakeDynamic(#screenInfo, #DisplayState, newState)
- if onFrame = 1 then
- set displaySprtNum to getaProp(displayObj, #SpriteNum)
- set the castNum of sprite displaySprtNum to getaProp(getaProp(displayObj, #cast), newState)
- updateStage()
- end if
- end
-
- on doExceedsCapacity
- setGasPINKeyState(#off)
- switchFeedback(#exceedsCapacity, 1)
- Startthetimer(120, "doResetPINScreen #enterPellQty,TRUE", #screenInfo)
- end
-
- on doNotEnoughCash
- setGasPINKeyState(#off)
- switchFeedback(#notEnoughCash, 1)
- Startthetimer(120, "doResetPINScreen #enterPellQty,TRUE", #screenInfo)
- end
-
- on doInValidGasPIN
- setGasPINKeyState(#off)
- switchFeedback(#unauthorizedPIN, 1)
- Startthetimer(120, "doResetPINScreen #enterPIN,TRUE", #screenInfo)
- end
-
- on doIssuePellets numPellets, fuelLevel
- set newFuelLevel to integer(fuelLevel + numPellets)
- MakeDynamic(#CarGasGauge, #fuelLevel, newFuelLevel)
- changeGasGauge(newFuelLevel + 1, #false)
- set Credits to getaProp(gStates, #Credits)
- set totalCharge to 10 * numPellets
- setaProp(gStates, #Credits, integer(Credits - totalCharge))
- set feedbackState to value("#CredsChrge" & integer(totalCharge))
- switchFeedback(feedbackState, 1)
- Startthetimer(120, "doResetPINScreen #enterPIN,TRUE", #screenInfo)
- playSound(string(numPellets & "Pell.aif"), #cast, 0)
- end
-
- on setGasPINKeyState setState
- if symbolp(setState) then
- MakeDynamic(#GasStation, #State, setState)
- else
- alert("bad parameter passed to setShortKeyBoardState")
- end if
- end
-
- on displayGasPINFeedback inCastName
- set feedbackCastNum to the number of cast inCastName
- set shortFeedBackSprite to getaProp(getaProp(gObjects, #shortFeedback), #SpriteNum)
- set the castNum of sprite shortFeedBackSprite to feedbackCastNum
- updateStage()
- end
-
- on doValidGasPIN
- doResetPINScreen(#enterPellQty, 1)
- end
-
- on doResetPINScreen whichState, onFrame
- repeat with X = 1 to 4
- set PINDispObj to getaProp(gObjects, value("#PINDisp" & X))
- if onFrame = 1 then
- set PDSprtNum to getaProp(PINDispObj, #SpriteNum)
- set the castNum of sprite PDSprtNum to getAt(getaProp(getaProp(PINDispObj, #cast), #blank), 1)
- end if
- setaProp(getaProp(gObjects, value("#PINDisp" & X)), #DisplayState, #blank)
- end repeat
- setGasPINKeyState(#on)
- MakeDynamic(#GasStation, #GasPINDisplay, EMPTY)
- switchFeedback(whichState, onFrame)
- end
-
- on doGasManQT
- set clickCount to getaProp(getaProp(gObjects, #GasManQT), #clickCount) + 1
- MakeDynamic(#GasManQT, #clickCount, clickCount)
- pickGasMan(clickCount)
- set the movieRate of sprite sQTCharSprite to 0
- set the movieTime of sprite sQTCharSprite to 0
- set the movieRate of sprite sQTCharSprite to 1
- end
-
- on pickGasMan playCount
- set gasManObj to getaProp(gObjects, #GasManQT)
- if getaProp(gStates, #Credits) > 0 then
- set droveOrTowed to getaProp(gasManObj, #droveOrTowed)
- set curZone to getaProp(getaProp(gObjects, #carMap), #curZone)
- set stationNum to getPos(getaProp(gasManObj, #stationLocs), integer(curZone))
- if droveOrTowed = #drove then
- if stationNum = 4 then
- if playCount = 1 then
- set State to #G4a
- else
- if playCount = 2 then
- set State to #G4b
- else
- if playCount = 3 then
- set State to #G4c
- else
- set State to #G4d
- end if
- end if
- end if
- else
- if stationNum = 11 then
- if playCount = 1 then
- set State to #G11a
- else
- if playCount = 2 then
- set State to #G11b
- else
- set State to #G11c
- end if
- end if
- else
- if stationNum = 12 then
- if playCount = 1 then
- set State to #G12a
- else
- if playCount = 2 then
- set State to #G12b
- else
- set State to #G12c
- end if
- end if
- else
- set whichStation to value("#G" & stationNum)
- if playCount = 1 then
- set State to whichStation & "a"
- else
- set State to whichStation & "b"
- end if
- end if
- end if
- end if
- else
- set runoutCount to getaProp(getaProp(gObjects, #CarGasGauge), #runoutCount)
- if runoutCount <> 4 then
- if stationNum = 1 then
- set State to #towedToG1
- set E04gas01Count to getaProp(getaProp(gObjects, #GasManQT), #E04gas01Count)
- if E04gas01Count = 0 then
- set E04gas01Count to E04gas01Count + 1
- MakeDynamic(#GasManQT, #E04gas01Count, E04gas01Count)
- end if
- else
- set whichMov to random(8)
- set State to value("#towed" & whichMov)
- end if
- else
- if playCount = 1 then
- set State to #Agent
- set curCreds to getaProp(gStates, #Credits)
- set curDebt to getaProp(gStates, #Debt)
- if curDebt > curCreds then
- set curDebt to curDebt - curCreds
- set curCreds to 0
- else
- set curDebt to 0
- set curCreds to curCreds - curDebt
- end if
- setaProp(gStates, #Credits, integer(curCreds))
- setaProp(gStates, #Debt, curDebt)
- else
- set State to #empty
- end if
- end if
- end if
- else
- if playCount = 1 then
- set State to #noCredits1
- else
- set runoutCount to getaProp(getaProp(gObjects, #CarGasGauge), #runoutCount)
- if runoutCount <> 4 then
- set State to #noCredits2
- else
- set State to #empty
- end if
- end if
- end if
- if State = #empty then
- abort()
- end if
- MakeDynamic(#GasManQT, #State, State)
- MakeDynamic(#GasManQT, #DisplayState, getaProp(getaProp(gObjects, #GasManQT), #State))
- if playCount > 1 then
- DoCharacterMovie(#GasManQT)
- end if
- end
-
- on doGasLookLeft
- Jumptokey(#E01)
- CursorandUpdate()
- end
-